Optimal. Leaf size=63 \[ \frac {(A b-a B) \sqrt {x}}{a b (a+b x)}+\frac {(A b+a B) \tan ^{-1}\left (\frac {\sqrt {b} \sqrt {x}}{\sqrt {a}}\right )}{a^{3/2} b^{3/2}} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.02, antiderivative size = 63, normalized size of antiderivative = 1.00, number of steps
used = 4, number of rules used = 4, integrand size = 29, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.138, Rules used = {27, 79, 65, 211}
\begin {gather*} \frac {(a B+A b) \text {ArcTan}\left (\frac {\sqrt {b} \sqrt {x}}{\sqrt {a}}\right )}{a^{3/2} b^{3/2}}+\frac {\sqrt {x} (A b-a B)}{a b (a+b x)} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 27
Rule 65
Rule 79
Rule 211
Rubi steps
\begin {align*} \int \frac {A+B x}{\sqrt {x} \left (a^2+2 a b x+b^2 x^2\right )} \, dx &=\int \frac {A+B x}{\sqrt {x} (a+b x)^2} \, dx\\ &=\frac {(A b-a B) \sqrt {x}}{a b (a+b x)}+\frac {(A b+a B) \int \frac {1}{\sqrt {x} (a+b x)} \, dx}{2 a b}\\ &=\frac {(A b-a B) \sqrt {x}}{a b (a+b x)}+\frac {(A b+a B) \text {Subst}\left (\int \frac {1}{a+b x^2} \, dx,x,\sqrt {x}\right )}{a b}\\ &=\frac {(A b-a B) \sqrt {x}}{a b (a+b x)}+\frac {(A b+a B) \tan ^{-1}\left (\frac {\sqrt {b} \sqrt {x}}{\sqrt {a}}\right )}{a^{3/2} b^{3/2}}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.09, size = 64, normalized size = 1.02 \begin {gather*} -\frac {(-A b+a B) \sqrt {x}}{a b (a+b x)}+\frac {(A b+a B) \tan ^{-1}\left (\frac {\sqrt {b} \sqrt {x}}{\sqrt {a}}\right )}{a^{3/2} b^{3/2}} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.62, size = 57, normalized size = 0.90
method | result | size |
derivativedivides | \(\frac {\left (A b -B a \right ) \sqrt {x}}{a b \left (b x +a \right )}+\frac {\left (A b +B a \right ) \arctan \left (\frac {b \sqrt {x}}{\sqrt {a b}}\right )}{a b \sqrt {a b}}\) | \(57\) |
default | \(\frac {\left (A b -B a \right ) \sqrt {x}}{a b \left (b x +a \right )}+\frac {\left (A b +B a \right ) \arctan \left (\frac {b \sqrt {x}}{\sqrt {a b}}\right )}{a b \sqrt {a b}}\) | \(57\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.50, size = 58, normalized size = 0.92 \begin {gather*} -\frac {{\left (B a - A b\right )} \sqrt {x}}{a b^{2} x + a^{2} b} + \frac {{\left (B a + A b\right )} \arctan \left (\frac {b \sqrt {x}}{\sqrt {a b}}\right )}{\sqrt {a b} a b} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 2.51, size = 177, normalized size = 2.81 \begin {gather*} \left [-\frac {{\left (B a^{2} + A a b + {\left (B a b + A b^{2}\right )} x\right )} \sqrt {-a b} \log \left (\frac {b x - a - 2 \, \sqrt {-a b} \sqrt {x}}{b x + a}\right ) + 2 \, {\left (B a^{2} b - A a b^{2}\right )} \sqrt {x}}{2 \, {\left (a^{2} b^{3} x + a^{3} b^{2}\right )}}, -\frac {{\left (B a^{2} + A a b + {\left (B a b + A b^{2}\right )} x\right )} \sqrt {a b} \arctan \left (\frac {\sqrt {a b}}{b \sqrt {x}}\right ) + {\left (B a^{2} b - A a b^{2}\right )} \sqrt {x}}{a^{2} b^{3} x + a^{3} b^{2}}\right ] \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [B] Leaf count of result is larger than twice the leaf count of optimal. 615 vs.
\(2 (53) = 106\).
time = 2.79, size = 615, normalized size = 9.76 \begin {gather*} \begin {cases} \tilde {\infty } \left (- \frac {2 A}{3 x^{\frac {3}{2}}} - \frac {2 B}{\sqrt {x}}\right ) & \text {for}\: a = 0 \wedge b = 0 \\\frac {- \frac {2 A}{3 x^{\frac {3}{2}}} - \frac {2 B}{\sqrt {x}}}{b^{2}} & \text {for}\: a = 0 \\\frac {2 A \sqrt {x} + \frac {2 B x^{\frac {3}{2}}}{3}}{a^{2}} & \text {for}\: b = 0 \\\frac {A a b \log {\left (\sqrt {x} - \sqrt {- \frac {a}{b}} \right )}}{2 a^{2} b^{2} \sqrt {- \frac {a}{b}} + 2 a b^{3} x \sqrt {- \frac {a}{b}}} - \frac {A a b \log {\left (\sqrt {x} + \sqrt {- \frac {a}{b}} \right )}}{2 a^{2} b^{2} \sqrt {- \frac {a}{b}} + 2 a b^{3} x \sqrt {- \frac {a}{b}}} + \frac {2 A b^{2} \sqrt {x} \sqrt {- \frac {a}{b}}}{2 a^{2} b^{2} \sqrt {- \frac {a}{b}} + 2 a b^{3} x \sqrt {- \frac {a}{b}}} + \frac {A b^{2} x \log {\left (\sqrt {x} - \sqrt {- \frac {a}{b}} \right )}}{2 a^{2} b^{2} \sqrt {- \frac {a}{b}} + 2 a b^{3} x \sqrt {- \frac {a}{b}}} - \frac {A b^{2} x \log {\left (\sqrt {x} + \sqrt {- \frac {a}{b}} \right )}}{2 a^{2} b^{2} \sqrt {- \frac {a}{b}} + 2 a b^{3} x \sqrt {- \frac {a}{b}}} + \frac {B a^{2} \log {\left (\sqrt {x} - \sqrt {- \frac {a}{b}} \right )}}{2 a^{2} b^{2} \sqrt {- \frac {a}{b}} + 2 a b^{3} x \sqrt {- \frac {a}{b}}} - \frac {B a^{2} \log {\left (\sqrt {x} + \sqrt {- \frac {a}{b}} \right )}}{2 a^{2} b^{2} \sqrt {- \frac {a}{b}} + 2 a b^{3} x \sqrt {- \frac {a}{b}}} - \frac {2 B a b \sqrt {x} \sqrt {- \frac {a}{b}}}{2 a^{2} b^{2} \sqrt {- \frac {a}{b}} + 2 a b^{3} x \sqrt {- \frac {a}{b}}} + \frac {B a b x \log {\left (\sqrt {x} - \sqrt {- \frac {a}{b}} \right )}}{2 a^{2} b^{2} \sqrt {- \frac {a}{b}} + 2 a b^{3} x \sqrt {- \frac {a}{b}}} - \frac {B a b x \log {\left (\sqrt {x} + \sqrt {- \frac {a}{b}} \right )}}{2 a^{2} b^{2} \sqrt {- \frac {a}{b}} + 2 a b^{3} x \sqrt {- \frac {a}{b}}} & \text {otherwise} \end {cases} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 1.14, size = 60, normalized size = 0.95 \begin {gather*} \frac {{\left (B a + A b\right )} \arctan \left (\frac {b \sqrt {x}}{\sqrt {a b}}\right )}{\sqrt {a b} a b} - \frac {B a \sqrt {x} - A b \sqrt {x}}{{\left (b x + a\right )} a b} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 1.18, size = 51, normalized size = 0.81 \begin {gather*} \frac {\mathrm {atan}\left (\frac {\sqrt {b}\,\sqrt {x}}{\sqrt {a}}\right )\,\left (A\,b+B\,a\right )}{a^{3/2}\,b^{3/2}}+\frac {\sqrt {x}\,\left (A\,b-B\,a\right )}{a\,b\,\left (a+b\,x\right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________